﻿
Partial Class MasterPage
    Inherits System.Web.UI.MasterPage

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        'first time load
        If Not (IsPostBack) Then
            If Session("username") <> "Guest" Then
                LinkButton2.Visible = False
                LinkButton1.Visible = False
                LinkButton3.Visible = True
                LinkButton4.Visible = True
            Else
                LinkButton3.Visible = False
                LinkButton2.Visible = True
                LinkButton1.Visible = True
                LinkButton4.Visible = False
            End If
        End If
    End Sub

    Protected Sub LinkButton4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton4.Click
        Try
            Session("username") = "Guest"
            Response.Redirect("loggedout.aspx")
        Catch ex As Exception

        End Try


    End Sub
End Class

